package com.qingshu.common.util.zookeeper;

/**
 * 描述
 *
 * @author Huzz
 * @create 2022-07-20 20:00
 */
public class Test {
    public static void main(String[] args) {
        try {
            testZK();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void testZK() throws Exception {
        for(int i = 0 ; i < 10 ; i++){
            new Thread(()->{
                ZookeeperLock zookeeperLock = new ZookeeperLock();
                boolean getLock = zookeeperLock.getLock("order");

                System.out.println("是否获取到锁："+getLock);

                zookeeperLock.close();
            }).start();
        }
        Thread.sleep(5000);
    }
}
